package com.hdoit.ares.selfcommon.utils;

import java.util.Date;

import com.hdoit.ares.logical.insu.model.FanhuaAccident;

public class AccidentStateUtil {

	public static void changeState(FanhuaAccident fanhuaAccident){
		
		Date statetime = fanhuaAccident.getStartTime();
		Date endtime = fanhuaAccident.getEndTime();
		Date nowtime = new Date();
			
		long statetimeLong = statetime.getTime();		
		long endtimeLong = endtime.getTime();		
		long nowtimeLong =nowtime.getTime();
		
		if(nowtimeLong<statetimeLong){
			fanhuaAccident.setSumState("ready");
		}
		if(nowtimeLong>statetimeLong && nowtimeLong<endtimeLong){
			fanhuaAccident.setSumState("ok");
		}
		if(nowtimeLong>endtimeLong){
			fanhuaAccident.setSumState("no");
		}

	}
}
